/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.dorian.atomicuml.orm;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;

/**
 *
 * @author cedric.creusot
 */
@Entity
@Table(name = "DIAGRAMMS_PROJECTS", catalog = "dorian", schema = "")
@NamedQueries({
    @NamedQuery(name = "DiagrammsProjects.findAll", query = "SELECT d FROM DiagrammsProjects d"),
    @NamedQuery(name = "DiagrammsProjects.findById", query = "SELECT d FROM DiagrammsProjects d WHERE d.id = :id"),
    @NamedQuery(name = "DiagrammsProjects.findByDiagrammsId", query = "SELECT d FROM DiagrammsProjects d WHERE d.diagrammsId = :diagrammsId"),
    @NamedQuery(name = "DiagrammsProjects.findByProjectsId", query = "SELECT d FROM DiagrammsProjects d WHERE d.projectsId = :projectsId"),
    @NamedQuery(name = "DiagrammsProjecs.findByDiagrammsIdAndProjectsId", query = "SELECT d FROM DiagrammsProjects d where d.diagrammsId = :diagrammsId and d.projectsId = :projectsId")})
public class DiagrammsProjects implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @NotNull
    @Column(name = "ID")
    private Integer id;
    @Basic(optional = false)
    @NotNull
    @Column(name = "DIAGRAMMS_ID")
    private int diagrammsId;
    @Basic(optional = false)
    @NotNull
    @Column(name = "PROJECTS_ID")
    private int projectsId;

    public DiagrammsProjects() {
    }

    public DiagrammsProjects(Integer id) {
        this.id = id;
    }

    public DiagrammsProjects(Integer id, int diagrammsId, int projectsId) {
        this.id = id;
        this.diagrammsId = diagrammsId;
        this.projectsId = projectsId;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public int getDiagrammsId() {
        return diagrammsId;
    }

    public void setDiagrammsId(int diagrammsId) {
        this.diagrammsId = diagrammsId;
    }

    public int getProjectsId() {
        return projectsId;
    }

    public void setProjectsId(int projectsId) {
        this.projectsId = projectsId;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DiagrammsProjects)) {
            return false;
        }
        DiagrammsProjects other = (DiagrammsProjects) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.dorian.atomicuml.orm.DiagrammsProjects[ id=" + id + " ]";
    }
    
}
